//
//  CustomTableViewCell.m
//  testTableViewCell
//
//  Created by 梁昆 on 16/9/13.
//  Copyright © 2016年 segiK. All rights reserved.
//
#import "CustomTableViewCell.h"

@implementation CustomTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)reuseIdentifier
{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSeparatorStyleNone;
        [self viewdidload];
    }
    return self;
}

#pragma mark - 加载

- (void)viewdidload
{
    [self.contentView addSubview:self.contentLabel];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker* make) {
        make.top.bottom.equalTo(self.contentView);
        make.left.equalTo(self.contentView).mas_offset(15);

    }];

    [self.contentView addSubview:self.line];
    [self.line mas_makeConstraints:^(MASConstraintMaker* make) {
        make.top.left.right.equalTo(self.contentView);
        make.height.mas_equalTo(0.5);
    }];

    [self.contentView addSubview:self.imageSelect];
    [self.imageSelect mas_makeConstraints:^(MASConstraintMaker* make) {
        make.top.equalTo(self.contentView);
        make.bottom.equalTo(self.contentView);
        make.left.equalTo(self.contentView.mas_right).mas_offset(-30);
    }];
}

#pragma mark - getter

- (UIImageView*)imageSelect
{
    if (!_imageSelect) {
        _imageSelect = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:SEGPicName(@"btn_list_select")]];
        _imageSelect.contentMode = UIViewContentModeScaleAspectFit;
        [_imageSelect setHidden:YES];
    }
    return _imageSelect;
}

- (UIView*)line
{
    if (!_line) {
        _line = [[UIView alloc] init];
        _line.backgroundColor = kColor_L2;
    }
    return _line;
}

- (UILabel*)contentLabel
{
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc] init];
        [_contentLabel setTextColor:kColor_1];
        [_contentLabel setFont:[UIFont systemFontOfSize:FONT_LIST_AND_DETAIL_SIZE]];
    }
    return _contentLabel;
}

@end
